using System;
using System.Configuration;
using PlugIn;

namespace Screenshots
{

	class PlugIn : IPlugin
	{
		
		private Main m_PluginForm = null;
		private IPluginHost m_Host = null;
		private Version m_Version = null;
		private AppSettings m_Settings = null;
		private System.Configuration.AppSettingsSection m_SettingsSection = null;
		private string m_FileName = null;
		private bool m_Registered = false;
		
		public PlugIn()
		{
			m_PluginForm = new Main(this);
		}
		
		public string Name
		{
			get{return (string)m_PluginForm.Tag;}
			set{m_PluginForm.Tag=value;}
		}
		
		public string FileName
		{
			get{return m_FileName;}
			set{m_FileName=value;}
		}

		public Version PIVersion
		{
			get{return m_Version;}
			set{m_Version=value;}
		}

		public AppSettings Settings{
			get{return m_Settings;}
			set{m_Settings=value;}
		}
		
		public AppSettingsSection SettingsSection{
			get{return m_SettingsSection;}
			set{m_SettingsSection=value;}
		}
		
		public System.Windows.Forms.Control PluginForm
		{
			get{return m_PluginForm;}
		}
		
		public IPluginHost Host
		{
			get{return m_Host;}
			set
			{
				m_Host=value;
				m_Registered = m_Host.Register(this);
			}
		}
		
		/// <summary>
		/// Return true if plugin has been sucessfully registered with the host.
		/// </summary>
		public bool Registered
		{
			get{return m_Registered;}
		}
		
	}
}
